Skip to content

all: remove ethash pow, only retain shims needed for consensus and tests#27178

Merged
karalabe merged 4 commits into
ethereum:masterfrom
karalabe:nuke-pow
May 3, 2023
Merged

all: remove ethash pow, only retain shims needed for consensus and tests#27178
karalabe merged 4 commits into
ethereum:masterfrom
karalabe:nuke-pow

Conversation

@karalabe
Copy link
Copy Markdown
Member

@karalabe karalabe commented Apr 27, 2023

Remove PoW 😅

The PR also removes the ethash related flags, configs and API methods in a non-backwards compatible way. There is quite a bit of stuff that we'd need to keep dangling in the code to avoid "that one user" not having upgrade issues. As we're right after a fork, there's no immediate urgency to update, might as well bork things now.

Probably the PR should add some vocal failure modes for running Geth in non-beacon-ethash mode. Done!

We also need a followup PR to move the consensus things into a legacy or historical package (or directly into the beacon package) and to rewrite the tests to use some beacon shims instead of the current skeletons in ethash. Then we can be free. That needs a bit of refactor so I wanted to start by mass removes and then review the refactors separately more easily.

@sandakersmann
Copy link
Copy Markdown
Contributor

You also have some residue in the lower parts of README.md about running a private miner.

Comment thread cmd/evm/internal/t8ntool/flags.go Outdated
@karalabe karalabe added this to the 1.11.7 milestone May 3, 2023
@karalabe karalabe merged commit dde2da0 into ethereum:master May 3, 2023
Copy link
Copy Markdown
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Comment thread miner/worker_test.go
}

func TestGenerateBlockAndImportEthash(t *testing.T) {
testGenerateBlockAndImport(t, false)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also remove the functionality in the test? L 229ff

@zhiqiangxu
Copy link
Copy Markdown
Contributor

Does this mean go-ethereum doesn't support sync from genesis any more?

@karalabe
Copy link
Copy Markdown
Member Author

karalabe commented Jun 6, 2023 via email

shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
…sts (ethereum#27178)

* all: remove ethash pow, only retain shims needed for consensus and tests

* all: thank you linter

* all: disallow launching Geth in legacy PoW mode

* cmd/env/internal/t8ntool: remove dangling ethash flag
holiman added a commit that referenced this pull request Jul 6, 2023
Back before #27178 , we spun up a number of ethash verifiers to verify headers. So we also had tests to ensure that we were indeed able to abort verification even if we had multiple workers running.

With PR #27178, we removed the parallelism in verification, and these tests are now failing, since we now just sequentially fire away the results as fast as possible on one routine.

This change removes the (sometimes failing) tests
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
…sts (ethereum#27178)

* all: remove ethash pow, only retain shims needed for consensus and tests

* all: thank you linter

* all: disallow launching Geth in legacy PoW mode

* cmd/env/internal/t8ntool: remove dangling ethash flag
devopsbo3 pushed a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
Back before ethereum#27178 , we spun up a number of ethash verifiers to verify headers. So we also had tests to ensure that we were indeed able to abort verification even if we had multiple workers running.

With PR ethereum#27178, we removed the parallelism in verification, and these tests are now failing, since we now just sequentially fire away the results as fast as possible on one routine.

This change removes the (sometimes failing) tests
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
devopsbo3 added a commit to HorizenOfficial/go-ethereum that referenced this pull request Nov 10, 2023
dimpar added a commit to mezo-org/mezod that referenced this pull request Aug 29, 2024
As per ethereum/go-ethereum#27178 it removes the
PoW and some of the API methods with it. SeedHash is one of them.
rjl493456442 pushed a commit that referenced this pull request Aug 26, 2025
gballet pushed a commit to gballet/go-ethereum that referenced this pull request Sep 11, 2025
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 12, 2026
Reintroduce ethash (purged upstream PR ethereum#27178) and add the ETC consensus
engine wrapper. Required for any PoW chain support.

- consensus/ethash: full restore of Ethash with mmap-based DAG, sealer,
  algorithm internals, RPC API, and DAG verification.
- consensus/etc: ETC engine wraps ethash and adds ECIP-1017 monetary
  policy + ECIP-1010 bomb defuse rewards adjustments.
- core/vm: ETC-specific EVM behavior (Mystique = London without EIP-1559,
  Spiral activates EIP-3860 subset, EIP-160 ETC-specific timing).
- core/state_transition, core/txpool/validation: IntrinsicGas honors
  Spiral as an EIP-3860 activator.
- go.mod, go.sum: +github.com/edsrzf/mmap-go (for DAG mmap), promote
  gonum.org/v1/gonum to direct (used by sealer for nonce distribution).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 12, 2026
Reintroduce total-difficulty-aware chain state for perpetual PoW chains.
Upstream purged TD from the canonical chain in PRs ethereum#27178 and ethereum#29281 as
part of the post-Merge cleanup; ETC needs it back.

- core/rawdb: TD accessors + PoW ancient scheme entries.
- core/blockchain, core/blockchain_pow: PoW-aware block insertion paths
  that consult TD.
- core/headerchain, core/headerchain_pow: TD propagation through header
  chain.
- core/forkchoice_pow: TD-based forkchoice for PoW.
- core/genesis, core/genesis_etc: ETC genesis presets (Classic, Mordor)
  honor ECIP-1041/1099 etc.
- eth/ethconfig: Ethash config field on Config; PoW-specific defaults in
  config_pow.go.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 12, 2026
Reintroduce ethash (purged upstream PR ethereum#27178) and add the ETC consensus
engine wrapper. Required for any PoW chain support.

- consensus/ethash: full restore of Ethash with mmap-based DAG, sealer,
  algorithm internals, RPC API, and DAG verification.
- consensus/etc: ETC engine wraps ethash and adds ECIP-1017 monetary
  policy + ECIP-1010 bomb defuse rewards adjustments.
- core/vm: ETC-specific EVM behavior (Mystique = London without EIP-1559,
  Spiral activates EIP-3860 subset, EIP-160 ETC-specific timing).
- core/state_transition, core/txpool/validation: IntrinsicGas honors
  Spiral as an EIP-3860 activator.
- go.mod, go.sum: +github.com/edsrzf/mmap-go (for DAG mmap), promote
  gonum.org/v1/gonum to direct (used by sealer for nonce distribution).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 12, 2026
Reintroduce total-difficulty-aware chain state for perpetual PoW chains.
Upstream purged TD from the canonical chain in PRs ethereum#27178 and ethereum#29281 as
part of the post-Merge cleanup; ETC needs it back.

- core/rawdb: TD accessors + PoW ancient scheme entries.
- core/blockchain, core/blockchain_pow: PoW-aware block insertion paths
  that consult TD.
- core/headerchain, core/headerchain_pow: TD propagation through header
  chain.
- core/forkchoice_pow: TD-based forkchoice for PoW.
- core/genesis, core/genesis_etc: ETC genesis presets (Classic, Mordor)
  honor ECIP-1041/1099 etc.
- eth/ethconfig: Ethash config field on Config; PoW-specific defaults in
  config_pow.go.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 12, 2026
Upstream purged TD when it dropped pre-merge sync (PR ethereum#29281) and
removed it from the canonical chain (PR ethereum#27178). Reintroduce the
TD-aware code paths needed by an ETC node:

- core/rawdb: TD accessors (ReadTd / WriteTd / DeleteTd), the PoW
  ancient scheme entries, and the TD-aware chain freezer.
- core/blockchain: TD propagation through block insertion (forker
  consultation, TD bookkeeping during chain reorgs).
- core/blockchain_pow: PoW chain helpers that consult TD.
- core/headerchain, core/headerchain_pow: TD through HeaderChain.
- core/forkchoice_pow: the TD-based forkchoice algorithm.
- core/genesis: write the genesis TD on Commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 12, 2026
Upstream purged TD when it dropped pre-merge sync (PR ethereum#29281) and
removed it from the canonical chain (PR ethereum#27178). Reintroduce the
TD-aware code paths needed by an ETC node:

- core/rawdb: TD accessors (ReadTd / WriteTd / DeleteTd), the PoW
  ancient scheme entries, and the TD-aware chain freezer.
- core/blockchain: TD propagation through block insertion (forker
  consultation, TD bookkeeping during chain reorgs).
- core/blockchain_pow: PoW chain helpers that consult TD.
- core/headerchain, core/headerchain_pow: TD through HeaderChain.
- core/forkchoice_pow: the TD-based forkchoice algorithm.
- core/genesis: write the genesis TD on Commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 15, 2026
Upstream purged TD when it dropped pre-merge sync (PR ethereum#29281) and
removed it from the canonical chain (PR ethereum#27178). Reintroduce the
TD-aware code paths needed by an ETC node:

- core/rawdb: TD accessors (ReadTd / WriteTd / DeleteTd), the PoW
  ancient scheme entries, and the TD-aware chain freezer.
- core/blockchain: TD propagation through block insertion (forker
  consultation, TD bookkeeping during chain reorgs).
- core/blockchain_pow: PoW chain helpers that consult TD.
- core/headerchain, core/headerchain_pow: TD through HeaderChain.
- core/forkchoice_pow: the TD-based forkchoice algorithm.
- core/genesis: write the genesis TD on Commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
diega added a commit to diega/go-ethereum-classic that referenced this pull request May 15, 2026
Upstream purged TD when it dropped pre-merge sync (PR ethereum#29281) and
removed it from the canonical chain (PR ethereum#27178). Reintroduce the
TD-aware code paths needed by an ETC node:

- core/rawdb: TD accessors (ReadTd / WriteTd / DeleteTd), the PoW
  ancient scheme entries, and the TD-aware chain freezer.
- core/blockchain: TD propagation through block insertion (forker
  consultation, TD bookkeeping during chain reorgs).
- core/blockchain_pow: PoW chain helpers that consult TD.
- core/headerchain, core/headerchain_pow: TD through HeaderChain.
- core/forkchoice_pow: the TD-based forkchoice algorithm.
- core/genesis: write the genesis TD on Commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants